Repository navigation
Let a glob class range start at a leading ] [patch] - #180
Open
matt-edmondson wants to merge 1 commit into
Open
matt-edmondson wants to merge 1 commit into
matt-edmondson wants to merge 1 commit into
Conversation
ToGlobCharacterList refused to read a leading "]" as the start of a range, so "[]-a]" became the set "]", "-", "a" instead of the range "]".."a", missing "^", "_" and "`" and matching "-". FindGlobClassEnd already keeps a leading "]" from closing the class, so the range check needs no exception. Fixes #179 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017vfJW547mxaz1R4r27gAVm
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



ToGlobCharacterListrefused to start a range at a leading], so[]-a]was read as the set],-,a. POSIX and fnmatch read it as the range]..a, which is] ^ _a. The class missed^,_and ````, and it matched-, which it shouldn't. `[!]-a]` was inverted the same way.FindGlobClassEndalready starts looking for the closing bracket after a leading], so the exception in the range check isn't needed. This PR removes it.Tests
GlobClassMatchesEveryMemberOfEveryRange, run under both case sensitivities:[]-a]matches] ^ _aand rejects- b [`.[!]-a]is the reverse.[]a-]and[!]a-]rows, which end in a literal-, still pass.Overlap: #168 rewrites the doc comment directly above
ToGlobCharacterList. This PR leaves that comment alone and explains the change in a comment on the line itself. I checked locally that this branch merges cleanly with every other open branch in the repo.Fixes #179
Generated by Claude Code